LoginPanel={};
local this = LoginPanel;

function LoginPanel.new( )
    panelMgr:CreatePanel("Login",nil);
end

function LoginPanel.OnCreate(go )
end
function LoginPanel.OnClick( )
    log(this.username.text);
end
function LoginPanel.OnClose( )
    panelMgr:ClosePanel("Login");
    RegistPanel.new();
end

function LoginPanel.Awake( go )
    log("LoginPanel.Awake");
    this.gameObject=go;
    this.transform=go.transform;
    local  behavior = this.transform:GetComponent('LuaBehaviour');

    this.username=this.transform:Find("UserName"):GetComponent('InputField');
    this.password=this.transform:Find("PassWord"):GetComponent('InputField');

    this.loginBtn=this.transform:Find("LoginBtn").gameObject;
    this.RegistsBtn=this.transform:Find("RegistsBtn").gameObject;
    behavior:AddClick(this.loginBtn,this.OnClick);
    behavior:AddClick(this.RegistsBtn,this.OnClose);
end

function LoginPanel.Start()
    log("LoginPanel.Start");
end